﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace PJ.Data
{
    [Serializable]
    [DataContract]
    public abstract class BaseOrderedFragmentData : BaseEntityFragmentData, IOrderedFragmentData
    {
        private double m_Order;

        [DataMember]
        public double Order
        {
            get { return m_Order; }
            set { m_Order = value; }
        }

        protected BaseOrderedFragmentData()
        {
        }

        public override IObjectData Init(IObjectData data)
        {
            base.Init(data);
            this.Order = ((IOrderedFragmentData)data).Order;
            return this;
        }
        public override IObjectData Copy(IObjectData data)
        {
            base.Copy(data);
            this.Order = ((IOrderedFragmentData)data).Order;
            return this;
        }
        public override bool IsEqual(IObjectData data)
        {
            if (!base.IsEqual(data))
                return false;
            if (((IOrderedFragmentData)data).Order == this.Order)
                return true;
            return false;
        }


    }
}
